package com.wyzz.hr.pojo.base;

import com.wyzz.hr.pojo.Employee;
import com.wyzz.hr.pojo.Position;
import com.wyzz.hr.pojo.PositionBase;

import java.io.Serializable;

public abstract class BasePosition implements Serializable {

	public BasePosition() {
		hashCode = 0x80000000;
		initialize();
	}

	public BasePosition(String id) {
		hashCode = 0x80000000;
		setId(id);
		initialize();
	}

	public BasePosition(String id, String clientNo) {
		hashCode = 0x80000000;
		setId(id);
		setClientNo(clientNo);
		initialize();
	}

	protected void initialize() {
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
		hashCode = 0x80000000;
	}

	public Integer getPositionTakeNum() {
		return positionTakeNum;
	}

	public void setPositionTakeNum(Integer positionTakeNum) {
		this.positionTakeNum = positionTakeNum;
	}

	public String getClientNo() {
		return clientNo;
	}

	public void setClientNo(String clientNo) {
		this.clientNo = clientNo;
	}

	public PositionBase getPositionPbId() {
		return positionPbId;
	}

	public void setPositionPbId(PositionBase positionPbId) {
		this.positionPbId = positionPbId;
	}

	public Position getPositionParentId() {
		return positionParentId;
	}

	public void setPositionParentId(Position positionParentId) {
		this.positionParentId = positionParentId;
	}

	public Employee getPositionEmpNo() {
		return positionEmpNo;
	}

	public void setPositionEmpNo(Employee positionEmpNo) {
		this.positionEmpNo = positionEmpNo;
	}

	public boolean equals(Object obj) {
		if (null == obj)
			return false;
		if (!(obj instanceof Position))
			return false;
		Position position = (Position) obj;
		if (null == getId() || null == position.getId())
			return false;
		else
			return getId().equals(position.getId());
	}

	public int hashCode() {
		if (0x80000000 == hashCode) {
			if (null == getId())
				return super.hashCode();
			String hashStr = (new StringBuilder()).append(getClass().getName())
					.append(":").append(getId().hashCode()).toString();
			hashCode = hashStr.hashCode();
		}
		return hashCode;
	}

	public String toString() {
		return super.toString();
	}

	public static String REF = "Position";
	public static String PROP_POSITION_PARENT_ID = "positionParentId";
	public static String PROP_POSITION_EMP_NO = "positionEmpNo";
	public static String PROP_POSITION_TAKE_NUM = "positionTakeNum";
	public static String PROP_CLIENT_NO = "clientNo";
	public static String PROP_POSITION_PB_ID = "positionPbId";
	public static String PROP_ID = "id";
	private int hashCode;
	private String id;
	private Integer positionTakeNum;
	private String clientNo;
	private PositionBase positionPbId;
	private Position positionParentId;
	private Employee positionEmpNo;

}
